// 类型定义：弹幕数据、运行时实例、配置与指标

export type DanmakuMode = 'scroll' | 'top' | 'bottom';

export interface DanmakuItem {
  id: string;
  text: string;
  color?: string;
  speedPxPerSec?: number;
  timestamp?: number;
  mode?: DanmakuMode; // MVP: 'scroll'
  fontSize?: number;
  stroke?: boolean;
}

export interface DanmakuConfig {
  maxConcurrent: number;
  speedRange: [number, number];
  opacity: number;
  tracks: number;
  dprAware: boolean;
  enableStroke: boolean;
  fontFamily: string;
  fontSize: number; // 默认字号（px）
}

export interface RuntimeBullet {
  id: string;
  text: string;
  color: string;
  fontSize: number;
  width: number;
  trackIndex: number;
  x: number;
  y: number;
  speedPxPerSec: number;
  bornAtMs: number;
  mode?: DanmakuMode;
  ttlMs?: number; // 固定弹幕停留时长
}

export interface RendererMetrics {
  fps: number;
  droppedCount: number;
  inFlightCount: number;
  measureCacheSize: number;
}


